precision mediump float;

 varying mediump vec2 textureCoordinate;

 uniform sampler2D inputImageTexture;
 uniform sampler2D inputImageTexture2;

varying vec4 aPos;
uniform int vIsHalf;

 void main()
 {
     if(aPos.x > 0.0 || vIsHalf == 0){
            vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;

            texel = vec3(
                         texture2D(inputImageTexture2, vec2(texel.r, .16666)).r,
                         texture2D(inputImageTexture2, vec2(texel.g, .5)).g,
                         texture2D(inputImageTexture2, vec2(texel.b, .83333)).b);

            gl_FragColor = vec4(texel, 1.0);
    }else{
         gl_FragColor = texture2D(inputImageTexture, textureCoordinate);
    }
 }
